/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pruebaes.entidades;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author luisfernando
 */
@Entity
@Table(name = "formularios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Formularios.findAll", query = "SELECT f FROM Formularios f"),
    @NamedQuery(name = "Formularios.findById", query = "SELECT f FROM Formularios f WHERE f.id = :id"),
    @NamedQuery(name = "Formularios.findByNombre", query = "SELECT f FROM Formularios f WHERE f.nombre = :nombre"),
    @NamedQuery(name = "Formularios.findByCodigo", query = "SELECT f FROM Formularios f WHERE f.codigo = :codigo"),
    @NamedQuery(name = "Formularios.findByFecha", query = "SELECT f FROM Formularios f WHERE f.fecha = :fecha"),
    @NamedQuery(name = "Formularios.findByTitulopregunta", query = "SELECT f FROM Formularios f WHERE f.titulopregunta = :titulopregunta"),
    @NamedQuery(name = "Formularios.findByAnulado", query = "SELECT f FROM Formularios f WHERE f.anulado = :anulado")})
public class Formularios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 2147483647)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "codigo")
    private String codigo;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Size(max = 2147483647)
    @Column(name = "titulopregunta")
    private String titulopregunta;
    @Column(name = "anulado")
    private Boolean anulado;
    @OneToMany(mappedBy = "formulario")
    private List<Cabeceras> cabecerasList;
    @OneToMany(mappedBy = "formulario")
    private List<Requeridos> requeridosList;
    @OneToMany(mappedBy = "formulario")
    private List<Ciiunivel7> ciiunivel7List;
    @OneToMany(mappedBy = "formulario")
    private List<Preguntas> preguntasList;
    @OneToMany(mappedBy = "formulario")
    private List<Variablesriesgos> variablesriesgosList;

    public Formularios() {
    }

    public Formularios(Integer id) {
        this.id = id;
    }

    public Formularios(Integer id, String codigo) {
        this.id = id;
        this.codigo = codigo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getTitulopregunta() {
        return titulopregunta;
    }

    public void setTitulopregunta(String titulopregunta) {
        this.titulopregunta = titulopregunta;
    }

    public Boolean getAnulado() {
        return anulado;
    }

    public void setAnulado(Boolean anulado) {
        this.anulado = anulado;
    }

    @XmlTransient
    public List<Cabeceras> getCabecerasList() {
        return cabecerasList;
    }

    public void setCabecerasList(List<Cabeceras> cabecerasList) {
        this.cabecerasList = cabecerasList;
    }

    @XmlTransient
    public List<Requeridos> getRequeridosList() {
        return requeridosList;
    }

    public void setRequeridosList(List<Requeridos> requeridosList) {
        this.requeridosList = requeridosList;
    }

    @XmlTransient
    public List<Ciiunivel7> getCiiunivel7List() {
        return ciiunivel7List;
    }

    public void setCiiunivel7List(List<Ciiunivel7> ciiunivel7List) {
        this.ciiunivel7List = ciiunivel7List;
    }

    @XmlTransient
    public List<Preguntas> getPreguntasList() {
        return preguntasList;
    }

    public void setPreguntasList(List<Preguntas> preguntasList) {
        this.preguntasList = preguntasList;
    }

    @XmlTransient
    public List<Variablesriesgos> getVariablesriesgosList() {
        return variablesriesgosList;
    }

    public void setVariablesriesgosList(List<Variablesriesgos> variablesriesgosList) {
        this.variablesriesgosList = variablesriesgosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Formularios)) {
            return false;
        }
        Formularios other = (Formularios) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pruebaes.entidades.Formularios[ id=" + id + " ]";
    }
    
}
